<!DOCTYPE html>
<html ng-app="userService">
<head>
<meta charset="UTF-8">
<title>angular页面</title>
<script src="../js/jquery-1.10.2.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/angular.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/angular-resource.js" type="text/javascript" charset="utf-8"></script>
<script src="js/angular.js" type="text/javascript" charset="utf-8"></script>
</head>
<body ng-controller="userController">
    <div id="save"
        style="display: block; margin-left: auto; margin-right: auto;">
        <table>
            <tr style="display: none">
                <td>用户id</td>
                <td><input type="text" name="user.id"
                    ng-model="saveUser.id" /></td>
            </tr>
            <tr>
                <td>用户名</td>
                <td><input type="text" name="user.username"
                    ng-model="saveUser.username" /></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" name="user.password"
                    ng-model="saveUser.password" /></td>
            </tr>
            <tr>
                <td>用户姓名</td>
                <td><input type="text" name="user.cs"
                    ng-model="saveUser.realname" /></td>
            </tr>
            <tr>
                <td colspan="2"><input type="button" value="添加"
                    ng-click="addUserClick()" /></td>
            </tr>
        </table>
    </div>
    <div id="userList" style="margin-left: auto; margin-right: auto;">
        <table border="1" style="margin-left: auto; margin-right: auto;">
            <tr>
                <th>序号</th>
                <th>用户id</th>
                <th>用户名称</th>
                <th>用户密码</th>
                <th>用户姓名</th>
                <th>用户操作</th>
            </tr>
            <tr ng-repeat="user in mydata" ng-class-even="'even'"
                ng-class-odd="'odd'">
                <td>{{$index + 1}}</td>
                <td>{{user.id}}</td>
                <td>{{user.username}}</td>
                <td>{{user.password}}</td>
                <td>{{user.realname}}</td>
                <td><a href="" ng-click="updateUser(user)">修改</a> &nbsp; <a
                    href="" ng-click="deleteUser(user)">删除</a></td>
            </tr>
        </table>
    </div>
    <div id="update"
        style="display: block; margin-left: auto; margin-right: auto;">
        <table>
            <tr style="display: none">
                <td>用户id</td>
                <td><input type="text" id="id" name="user.id"
                    ng-model="modifyUser.id" /></td>
            </tr>
            <tr>
                <td>用户名</td>
                <td><input type="text" id="username" name="user.username"
                    ng-model="modifyUser.username" /></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" id="password"
                    name="user.password" ng-model="modifyUser.password" /></td>
            </tr>
            <tr>
                <td>用户姓名</td>
                <td><input type="text" id="cs" name="user.cs"
                    ng-model="modifyUser.realname" /></td>
            </tr>
            <tr>
                <td colspan="2"><input type="button" value="更新"
                    ng-click="updateUserClick()" /></td>
            </tr>
        </table>
    </div>
</body>
</html>